<?php


class allocationcontroller extends CI_Controller{
    public function __construct()
    {
        parent::__construct();
        $this->load->model('allocationmodel');
    }

    public function getfilteredreport()
    {
        $this->load->helper('form');
        $this->load->view('allocationfilter');
        $data['reportdata']=$this->allocationmodel->getdata();
        $this->load->view('allocationdataview',$data);
    }

    public function getinventoryrequirementreport(){
        $this->load->helper('form');
        $regionname = array('India','China','Affrica','US','UK');
        $data['allocationcount']=$this->allocationmodel->getinventorystatistics();
        $data['regionname']=$regionname;
        $i=0;
        foreach ($regionname as $region){
            $data['regionwiseinventorycount'][$i]=$this->allocationmodel->getinventoryofregion($region);
            $i=$i+1;}
        $data['allocateddevice']=$this->allocationmodel->getreportofallocateddevices();
        $this->load->view('allocationstat',$data);
    }


} 